package uk.co.cocking.getinline2.record.test;

import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;

import uk.co.cocking.getinline2.record.Record;

public class RecordMatcherForTesting extends TypeSafeMatcher<Record> {
	
	private final boolean[] values;
	int count = 0;

	public RecordMatcherForTesting(boolean...values) {
		this.values = values;
	}

	@Override
	public boolean matchesSafely(Record item) {
		return values[count++];
	}

	@Override
	public void describeTo(Description description) {
		description.appendText("a record which was "+(values[count]? "" : " not ")+" matched");
	}
}
